import request from '@/utils/request'

// 用户密码重置
export function updateUserPwd(oldPassword, newPassword) {
    const data = {
        oldPassword,
        newPassword
    }
    return request({
        url: '/system/user/profile/updatePwd',
        method: 'put',
        params: data
    })
}

// 登录方法
export function rlogin(username, password, code, uuid) {
    return request({
        url: '/third/auth/login',
        headers: {
            isToken: false
        },
        method: 'post',
        data: {username, password, code, uuid}
    })
}

// 获取验证码
export function getCodeImg() {
    return request({
        url: '/third/auth/code',
        headers: {
            isToken: false
        },
        method: 'get',
        timeout: 20000
    })
}

// 获取用户详细信息
export function getInfo() {
    return request({
        url: '/third/auth/getInfo',
        method: 'get'
    })
}

// 注册方法
export function register(data) {
    return request({
        url: '/third/auth/register',
        headers: {
            isToken: false
        },
        method: 'post',
        data: data
    })
}

// 刷新方法
export function refreshToken() {
    return request({
        url: '/third/auth/refresh',
        method: 'post'
    })
}

// 退出方法
export function rlogout() {
    return request({
        url: '/third/auth/logout',
        method: 'delete'
    })
}

